﻿var XmlHttp2;
function getXmlHttp2()
{
    try
    {
            //Neu la trinh duyet Firefox, Opera 8.0 +, Safari  
            XmlHttp2 = new XMLHttpRequest();			
    }
    catch (e1)
    {
        // Neu la Internet Explorer 6.0+
        try
        {
                XmlHttp2 = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e2)
        {
            try
            {
                //Neu la Internet Explorer 5.0+
                XmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e3)
            {
                    alert("Trinh duyet cua ban khong ho tro Ajax (Your browser does not support Ajax)");
                    return false;
            }
        }
    }
}
function HandleResponse1()
{
	if(XmlHttp2.readyState == 4)
	{
		if(XmlHttp2.status == 200)
		{		
                    ClearAndSetState1(XmlHttp2.responseText);
                    Clear();
		}
		else
		{
		    Clear();
			alert("Yeu cau cau ban khong thuc hien duoc" );                      
		}
	}	
}
function ClearAndSetState1(text)
{
    document.getElementById("detailProduct").innerHTML = text;	
}

  /*----------------------------    */      
function DetailProduct(product)
{             
alert ('tnb');
        var requestUrl;
            requestUrl = "DetailProduct.aspx?id="+product;
	getXmlHttp2();	
	if(XmlHttp2)
	{	 
        XmlHttp2.onreadystatechange = HandleResponse1;
		XmlHttp2.open("GET", requestUrl,true);
		XmlHttp2.send(null);                
	}   
}